import 'package:flutter/services.dart';
import 'package:flutter/material.dart';

class FlutterMeiQia {
  static const MethodChannel _channel = const MethodChannel('flutter_meiqia');
  static Future initMQ(String appKey) async {
    var res = await _channel.invokeMethod('initMQ', {'appKey': appKey});
    return res;
  }

  // static Future startMQ() async {
  //   var res = await _channel.invokeMethod('startMQ');
  //   return res;
  // }

  // static Future closeMQ() async {
  //   var res = await _channel.invokeMethod('closeMQ');
  //   return res;
  // }

  static Future pushToMQVC(
      {@required String userId,
      @required String name,
      @required String avatar}) async {
    var res = await _channel.invokeMethod(
        'pushToMQVC', {'userId': userId, 'userName': name, 'avatar': avatar});
    return res;
  }

  static Future getLocalUnreadeMessagesCount() async {
    var res = await _channel.invokeMethod('getLocalUnreadeMessagesCount');
    return res;
  }
}
